#ifndef GAMEDBINTERFACE_H
#define GAMEDBINTERFACE_H

#include "vpopts.h"
#include "progsql.h"

// type for holding unique game ids
#define VPOKER_GAMEID_SIZE		16
typedef char VPokerGameID[VPOKER_GAMEID_SIZE];


// this structure holds miscellaneous info about the current user session.
typedef struct _info
{
	String			login;
	PID				pid;
	SESSIONID		sessionId;
	VPokerGameID	gid;
	uint8			machineID;
	bool8			forMoney;
} Info, *pInfo;


class VPGameBase;
class VPConnection;


//***************************************************************************************************************
// kharmon.  03-22-06.  #10515.
//
// This class serves as a common interface for the VPConnection class to deal with the game specific database
// logic.  Each game type has it's own implementation of this interface that is used to hold database logic
// for that game type.
// 
//***************************************************************************************************************
class GameDBInterface
{

public:    

    // called to create objects that implement this interface
    static GameDBInterface * createDBInterface(VPConnection *pConn, ProgressiveTrackSQL *pTracker, Info *pInfo);

    // called to check for and restore saved games
    virtual bool8 processSavedGame(VPGameBase **ppGame, int32* err) = 0;

    // called to retrieve game settings (paytables, deck configurations, etc).
    virtual int32 getOptions(VPokerOpts*, uint8 machId, int32 creditValue) = 0;

    // called to get the compfactor for a game.
    virtual int32 getPlayerLimits(const PID&, int32 gameId, uint8 machId, int32* compFactor) = 0;

    // return codes for use by interface method implementations and any extra subclass methods
	enum GameSQLError
	{
        Success,
        UnknownError = TrackSQL::FIRST_GAME_ERROR,
		BadSavedGame,
		NotEnoughMoney
	};

};



#endif